/**
 * Created by Administrator on 2017/7/27.
 */
angular.module('service.common',['ngResource'])
    .service("ActivityService",["$resource",function ($resource) {
        this.addActivity=function(activity,sfun,efun){
            var resource=$resource(Activity_url+"/add");
            return resource.save(activity,sfun,efun)
        };
        this.getActivityListByOriginatorOrStateOrBothAndPageNum=function(query_terms,sfun,efun){
            var resource=$resource(Activity_url+"/getActiveListByOriginatorOrStateOrBoth");
            return resource.query(query_terms,sfun,efun)
        };
        this.getActivityListSumByOriginatorOrStateOrBothAndPageNum=function(query_terms,sfun,efun){
            var resource=$resource(Activity_url+"/getActiveListSumByOriginatorOrStateOrBoth");
            return resource.get(query_terms,sfun,efun);
        };
        this.getActivityByActivityId=function (query_terms,sfun,efun) {
            var resource=$resource(Activity_url+'/get');
            return resource.get(query_terms,sfun,efun)
        };
        this.updateActivity=function (activity,sfun,efun) {
            var resource=$resource(Activity_url+'/update');
            return resource.save(activity,sfun,efun)
        }
    }])
    .service("OriginatorService",["$resource",function ($resource) {
        this.addOriginator=function (Originator,sfun,efun) {
            var resource=$resource(originator_url+"/add");
            return resource.save(Originator,sfun,efun)
        };
        this.getOriginatorListByStateAndPageNum=function(query_terms,sfun,efun){
            var resource=$resource(originator_url+"/getOriginatorListByState");
            return resource.query(query_terms,sfun,efun)
        };
        this.getOriginatorListSumStateAndPageNum=function(query_terms,sfun,efun){
            var resource=$resource(originator_url+"/getOriginatorListSumByOriginatorState");
            return resource.get(query_terms,sfun,efun);
        };
        this.getOriginatorByOriginatorId=function(query_terms,sfun,efun){
            var resource=$resource(originator_url+'/getOriginatorById');
            return resource.get(query_terms,sfun,efun)
        };
        this.updateOriginator=function (Originator,sfun,efun) {
            var resource=$resource(originator_url+'/update');
            return resource.save(Originator,sfun,efun)
        }
    }])
    .service("ActiveEnrollService",['$resource',function ($resource) {
        this.get_active_enroll_list_by_id_or_state_and_id=function (query_terms,sfun,efun) {
            var resource=$resource(Activity_enroll_url+'/getActiveEnrllListByActiveId(mayState)');
            return resource.query(query_terms,sfun,efun)
        };
        this.update_active_enroll=function (active_enroll,sfun,efun) {
            var resource=$resource(Activity_enroll_url+'/update');
            return resource.save(active_enroll,sfun,efun)
        }
    }]);